﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FrameDisplayServer.UI.Settings
{
    public partial class PickBrowserTypeForm : Form
    {
        public PickBrowserTypeForm()
        {
            InitializeComponent();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (AppCentral.IsInitialized)
            {
                if (AppCentral.SettingsManager.BrowserType == "Mozilla")
                {
                    this.radioButtonFirefox.Checked = true;
                }
                else
                {
                    this.radioButtonIE.Checked = true;
                }
            }
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (this.radioButtonFirefox.Checked)
            {
                AppCentral.SettingsManager.BrowserType = "Mozilla";
            }
            else
            {
                AppCentral.SettingsManager.BrowserType = "IE";
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }


    }
}
